#include "baseeditor.h"

BaseEditor::BaseEditor(const QModelIndex &index,QWidget *parent):QDialog(parent)
{
    setAttribute(Qt::WA_DeleteOnClose);
    if(index==QModelIndex())
        mIsNew = true;
    else
        mIsNew = false;
#if QT_VERSION <0x050000
    mInputMethod = SyszuxIM::createSyszuxIM(this,QLocale::Chinese);
    QWSServer::setCurrentInputMethod(mInputMethod);
#endif
}

BaseEditor::~BaseEditor()
{
#if QT_VERSION <0x050000
    extern QWSInputMethod* gInputMethod;
    SyszuxIM::deleteSyszuxIM(mInputMethod);
    QWSServer::setCurrentInputMethod(gInputMethod);
#endif
}

